package com.hlkj.warboot.module_laboratory.controller;

/**
 * @Description: 小白外呼订单推送实体类
 * @Author: lixing
 * @Date: 2020/10/29 14:37
 */
public class OrderPushBasePojo {
    // 时间戳,必填。时间戳（YYYYMMDDHHMMSS）+4位随机码，作为一次会话唯一标识
    private String timeStamp;
    // 接口入参
    private OrderPushPojo orderPushPojo;

    public static boolean isEmpty(String param) {
        return null == param || param.length() == 0;
    }

    /*
     * @Description 校验非空字段
     * @Author lixing
     * @Date 2020/10/29 16:00
     * @Param [] 
     * @return java.lang.String
     */
    public static String checkNotNull(OrderPushBasePojo pojo) {
        if (isEmpty(pojo.getTimeStamp())) {
            return "timeStamp为必填项";
        }
        if (isEmpty(pojo.getOrderPushPojo().getPhoneNo())) {
            return "外呼号码为必填项";
        }
        if (isEmpty(pojo.getOrderPushPojo().getOrderNo())) {
            return "外呼工单号为必填项";
        }
        if (isEmpty(pojo.getOrderPushPojo().getBusType())) {
            return "操作类型为必填项";
        }
        if (isEmpty(pojo.getOrderPushPojo().getOrderType())) {
            return "单子类型为必填项";
        }
        return null;
    }

    public String getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

    public OrderPushPojo getOrderPushPojo() {
        return orderPushPojo;
    }

    public void setOrderPushPojo(OrderPushPojo orderPushPojo) {
        this.orderPushPojo = orderPushPojo;
    }
}
